
app.Router = Backbone.Router.extend({
	
	routes : {
		""			: "home",
		"home"		: "home",
		"admin"		: "admin",
		"logout"	: "logout",

		"agenda"	: "agenda",
		"health"	: "health",
		"billing"	: "billing",
		"shopping"	: "shopping",
		
	},

	initialize: function () {
		this.on('all', this.routeChangeHandler, this)
		app.chrome.chromeView = new app.chrome.ChromeView({ el : document.body });
		app.chrome.chromeView.render();
	},
	
	routeChangeHandler: function(route) {
		app.chrome.chromeView.updateMenu();
	},

	home: function () {
		app.home.homeView = new app.home.HomeView({el : $('#chromeViewContent') });
		app.home.homeView.render();
	},
	
	admin: function () {
		app.admin.adminView = new app.admin.AdminView({el : $('#chromeViewContent') });
		app.admin.adminView.render();
	},
	
	logout: function () {
	},
	
	
	
	
	agenda: function () {
		app.agenda.agendaView = new app.agenda.AgendaView({el : $('#chromeViewContent') });
		app.agenda.agendaView.render();
	},
	
	health: function () {
		app.health.healthView = new app.health.HealthView({el : $('#chromeViewContent') });
		app.health.healthView.render();
	},
	
	billing: function () {
		app.billing.billingView = new app.billing.BillingView({el : $('#chromeViewContent') });
		app.billing.billingView.render();
	},
	
	shopping: function () {
		app.shopping.shoppingView = new app.shopping.ShoppingView({el : $('#chromeViewContent') });
		app.shopping.shoppingView.render();
	},
	
});

$(function() {
	app.router = new app.Router();
	Backbone.history.start();
});
